class Style < ActiveRecord::Base
  has_many :materials,:dependent=>:delete_all
  

  #flash识别
  def cate
    return "ks"
  end


  MALE = 1
  FEMALE = 0

  SEX = [
    [ "男生", MALE ],
    [ "女生", FEMALE ]
  ]

  def self.get_all_for_xml
    self.find_by_sql('SELECT DISTINCT s.*
FROM materials m
INNER JOIN styles s ON s.id = m.style_id and s.active = 1' )
  end

  

end

